#!/usr/bin/env python
"""
# -*- coding: utf-8 -*-
# @Time    : 2020/9/27 17:26
# @Author  : AshJo
# @Desc    : 客户端
# @Filename: client.py
# @Version : v1.0
"""

import socket

sk = socket.socket()
sk.connect(('127.0.0.1', 9000))

while True:
    msg = sk.recv(1024).decode('utf-8')
    print(msg)
    if msg.upper() == 'Q':
        break
    send_msg = input('>>>').strip()
    sk.send(send_msg.encode('utf-8'))
    if send_msg.upper() == 'Q':
        break

sk.close()
